<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Insert title here</title>
    <link href="${pageContext.request.contextPath}/css/layout.css" rel="stylesheet" type="text/css"/>
    <link href="${pageContext.request.contextPath}/css/add.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.x.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/cascadingMenu.js"></script>
    <script type="text/javascript">
    </script>
</head>
<body>
<div class="place"><span>位置：</span>
    <ul class="placeul">
        <li><a href="${pageContext.request.contextPath}/backend/order/index" target="center">订单列表</a></li>
        <li><a href="#">订单详情</a></li>
    </ul>
</div>
<div class="formbody">
    <div class="usual">
        <div class="tabson">
            <table border="1" bordercolor="PaleGreen">

                <tr>
                    <td>id</td>
                    <td>${order.id}</td>
                </tr>

                <tr>
                    <td>订单号</td>
                    <td>${order.outTradeNo}</td>
                </tr>
                <tr>
                    <td>购买人</td>
                    <td>${order.user.username}</td>
                </tr>

                <tr>
                    <td>商品</td>
                    <td>
                        <c:choose>
                            <c:when test="${order.tails.size() > 0}">
                                <table border="1">
                                    <tr>
                                        <td>商品id</td>
                                        <td>商品名</td>
                                        <td>商品价格</td>
                                        <td>商品数量</td>
                                    </tr>
                                    <c:forEach items="${order.tails}" var="tail">
                                        <tr>
                                            <td>${tail.product.id}</td>
                                            <td>${tail.product.name}</td>
                                            <td>${tail.product.price}</td>
                                            <td>${tail.num}</td>
                                        </tr>
                                    </c:forEach>
                                </table>
                            </c:when>
                            <c:otherwise>
                                --
                            </c:otherwise>
                        </c:choose>
                    </td>
                </tr>

                <tr>
                    <td>总价</td>
                    <td>${order.mount}</td>
                </tr>
                <tr>
                    <td>状态</td>
                    <td>${order.statusName}</td>
                </tr>
                <tr>
                    <td>订单创建时间</td>
                    <td>${order.createdTime}</td>
                </tr>

            </table>
        </div>
    </div>
</div>
</body>
</html>